<div class="btn-group">
    <button id="refresh" class="btn btn-primary">刷新</button>
    <button id="status" class="btn btn-success">当前状态</button>
    <button id="apply" class="btn btn-danger">应用更改</button>
</div>
<div id="dhcp-root"></div>
<p>&nbsp;</p>
{% module Form(form) %}
        <div class="panel panel-default">
    <div class="panel-heading">
        固定IP设备列表
    </div>
    <table class="table table-hover">
        <thead>
        <tr>
            <td>id</td>
            <td>MAC</td>
            <td>IP</td>
            <td>最后更新</td>
        </tr>
        </thead>
        <tbody>
        {% for d in devices %}
        <tr>
            <td>{{d.id}}</td>
            <td>{{d.mac}}</td>
            <td>{{"%s.%s"% (net,d.ip)}}</td>
            <td>{{d.lastUpdated if d.lastUpdated else d.created }}</td>
        </tr>
        {% end %}
        </tbody>
    </table>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $("button#refresh").click(function () {
            new Ajax("tab-item-dhcp", "/itpkg/{{rid}}/dhcp");
        });
        $("button#apply").click(function () {
            new Ajax("dhcp-root", "/itpkg/{{rid}}/dhcp", "PUT", {act:"apply"}, undefined, false);
        });
        $("button#status").click(function () {
            new Ajax("dhcp-root", "/itpkg/{{rid}}/dhcp", "PUT", {act:"status"}, undefined, false);
        });
    });
</script>
